package com.szholly.pro.watergas_server.common.data;

import java.beans.PropertyVetoException;

import lrq.common.PropertiesUnit;
import lrq.data.DbExecuter;
import lrq.data.MsSqlExecuter;
import lrq.data.OracleExecuter;

public class DbManager 
{
	DbExecuter msSqlExecuter = null;
	DbExecuter oracleExecute = null;
	
	static DbManager dbm = null;
	
	public static DbManager getInstance() throws PropertyVetoException
	{
		if(dbm == null)
		{
			dbm = new DbManager();
		}
		return dbm;
	}
	
	private DbManager() throws PropertyVetoException
	{
		String msSqlConnStr = PropertiesUnit.getValue("mssqlDbConnStr");
		String oracleSqlConnStr = PropertiesUnit.getValue("oracleDbConnStr");
		
		msSqlExecuter =new MsSqlExecuter(msSqlConnStr);
		oracleExecute = new OracleExecuter(oracleSqlConnStr);
	}
	
	public DbExecuter getMsSqlExecuter()
	{
		return msSqlExecuter;
	}
	
	public DbExecuter getOracleExecuter(){
		return oracleExecute;
	}
}